package com.chenjian.annotation.listener;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

/**
 * web容器启动的时候监听servletcontext的创建
 * <p>
 * 创建后扫描配置的基础包，查找对应的been标记
 * <p>
 * 创建been池
 */
@WebListener

public class CustomServletContextListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        System.out.println("Listen to CustomServletContext will creation");
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        System.out.println("dest#############################");

    }
}
